package com.situ.day5;

//抽取所有对象的共同特征
//抽象
public class Student {
    //属性
    int id;//0
    String name;//null
    int age;//0
    String gender;//null
    //boolean flag;//false
    //int[] array;//null

    //方法
    public void study() {
        System.out.println(name + "正在学习");
    }

    public String getInfo() {
        String str = "Student{id: "+id+",name: "+name+",age: "+age+"}";
        return str;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                '}';
    }
}
